<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://amc.af.mil/portal-el" prefix="portal" %>
<%@ taglib uri="http://amc.af.mil/radtaglibrary" prefix="rad" %>
<%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html>
<head>
    <title>Edit User</title>
</head>

<body>

<rad:useBean id="userViewHelper"/>
<rad:useBean id="organizationViewHelper"/>
<c:set var="user" value="${userViewHelper.user}"/>

<div id="portal-left-bar">
    <jsp:include page="../../navigation/navigationMenu.jsp"/>
</div>

<div id="portal-content">
    <portal:box title="Edit User" style="width:800px">
        <html:form method="post" action="user/edit.do">
            <div id="user">
                <html:hidden property="userId" value="${user.id}"/>
                <p><label for="lastName">Last Name</label><html:text property="lastName" value="${user.lastName}"/></p>

                <p><label for="firstName">First Name</label><html:text property="firstName" value="${user.firstName}"/>
                </p>

                <p><label for="commPhone">Commercial Phone:</label><html:text property="commPhone"
                                                                              value="${user.comm}"/></p>

                <p><label for="dsnPhone">DSN Phone:</label><html:text property="dsnPhone" value="${user.dsn}"/></p>

                <p><label for="email">Email Address:</label><html:text property="email" value="${user.email}"/></p>

                <p><label for="organizationId">Organization: </label>
                    <html:select property="organizationId" value="${user.assignedOrganization.id}">
                        <html:optionsCollection name="organizationViewHelper"
                                                property="all"
                                                label="name"
                                                value="id"/>
                    </html:select>

                </p>

                <p><html:submit value="Edit"/></p>
            </div>
        </html:form>

    </portal:box>
</div>
</body>
</html>